// InsertSort.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "stdio.h"
#include "stdlib.h"
#include "time.h"

typedef int KeyType;
#include "SortPublic.h"
#include "ShellSort.h"
#include "InsertSort.h"
#include "SelectSort.h"
#include "HeapSort.h"
#include "BubbleSort.h"
#include "QuickSort.h"
#define MaxNum 20


int _tmain(int argc, _TCHAR* argv[])
{

	//time_t time1,time2;

	int i;
	DataType a[MaxNum];
	FILE *fp;
	if((fp = fopen("numbers.txt", "r"))==NULL)
		exit(0);

	for(i=0;i<MaxNum;i++)
	{
		fscanf(fp,"%d ",&a[i].key);
	}

	printf("Before Sort:\n");
	//time(&time1);
	PrintNumbers(a, MaxNum);
	//InsertSort(a,MaxNum);
	

	//int b[] = {5,4,3,2,1};
	//ShellSort(a,MaxNum,b,5);
	
	//SelectSort(a, 10);
	
	//HeapSort_(a,MaxNum);

	//BubbleSort(a,MaxNum);

	//BubbleSort__(a, MaxNum);
	QuickSort_(a,0,MaxNum-1);
	
	//time(&time2);
	printf("After Sort:\n");
	//printf("Time used in total: %ld",(time2-time1));
	PrintNumbers(a, MaxNum);

	getchar();
	
	return 0;
}